<?php

namespace app\backend\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'page' => 'integer',
        'limit' => 'integer',
        'money' => 'float',
        'id' => 'require|integer',
        'account' => 'require',
        'level_id' => 'require|integer',
        'password' => 'require',
        'pay_password' => 'require',
        'status' => 'require|in:0,1',
        'real_name' => 'require',
        'id_card' => 'require'
    ];

    protected $message = [
        'page.integer' => '页码格式错误',
        'limit.integer' => '条数格式错误',
        'money.float' => '金额错误',
        'id.require' => 'ID不能为空',
        'id.integer' => 'ID格式错误',
        'status.require' => '冻结状态不能为空',
        'status.in' => '冻结状态参数错误',
        'account.require' => '账户不能为空',
        'level_id.require' => '会员等级不能为空',
        'level_id.integer' => '会员等级格式错误',
        'password.require' => '登录密码不能为空',
        'pay_password.require' => '支付密码不能为空',
        'real_name.require' => '真实姓名不能为空',
        'id_card.require' => '身份证号码不能为空',
    ];

    protected $scene = [
        'index' => ['page', 'limit'],
        'recharge' => ['id', 'money'],
        'reduce' => ['id','money'],
        'editStatus' => ['id', 'status'],
        'editRixibaoMoney' => ['id', 'money'],
        'edit' => ['id','level_id','status'],
        'add' => ['account', 'password', 'pay_password', 'level_id', 'status'],
        'delBankCard' => ['id'],
        'editBankCard' => ['id'],
        'addUserAuth' => ['id','real_name','id_card'],
        'del' => ['id']
    ];
}
